from pinject import new_object_graph

from cms.application.service import BannerService
from cms.infrastructure import adapter, repository
from common.http_utils import SuccessResponse


def get_all_banners(request):
    obj_graph = new_object_graph(modules=[adapter, repository])
    service = obj_graph.provide(BannerService)
    return SuccessResponse(service.get_all_banners())
